﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;

namespace ChoMy.Helpers
{
    public class ImageHelper
    {
        public int Width(string url)
        {
            Bitmap bm = new Bitmap(HttpContext.Current.Server.MapPath(url), true);
            int width = bm.Width;
            bm.Dispose();

            return width;
        }

        public int Height(string url)
        {
            Bitmap bm = new Bitmap(HttpContext.Current.Server.MapPath(url), true);
            int height = bm.Height;
            bm.Dispose();

            return height;
        }

        public bool Standard(int width, int height, int standardWidth = 3570, int standardHeight = 4800)
        {
            return (standardWidth / (float)width == standardHeight / (float)height);
        }
    }
}